# Maintainer: Morten Linderud <foxboron@archlinux.org>
# Maintainer: Frederik Schwan <freswa at archlinux dot org>

pkgname=slirp4netns
pkgdesc='User-mode networking for unprivileged network namespaces'
pkgver=1.2.2
_commit=0ee2d87523e906518d34a6b423271e4826f71faf	#refs/tags/v1.2.2^{}
pkgrel=1
arch=(loong64 x86_64)
url="https://github.com/rootless-containers/slirp4netns"
license=(GPL2)
depends=(glibc glib2 libcap libseccomp libslirp)
makedepends=(git)
source=("git+$url#commit=$_commit?signed")
sha256sums=('SKIP')
validpgpkeys=('C020EA876CE4E06C7AB95AEF49524C6F9F638F1A') # Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/-/+/g'
}

prepare() {
  cd $pkgname
  autoreconf -fi
}

build() {
  cd $pkgname
  ./configure --prefix=/usr
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
